/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/media-picture.html#wxsaveimagetophotosalbumobject)
 */
export default function save_image_to_photos_album(filePath: string) {
	return new Promise<{
		success: boolean,
		msg: string
	}>((resolve, reject) => {
		wx.saveImageToPhotosAlbum({
			filePath,
			success(res) {
				resolve({
					msg: res.errMsg,
					success: true
				});
			},
			fail(res) {
				reject({
					msg: res,
					success: false
				});
			}
		});
	});
}
